import request from '@/utils/request'

//获取用户数据
export const GetUsers=(obj:{page:number,limit:number,key:string,isBan:number,isActive:number})=>{
    return request({
        method:'get',
        params:obj,
        url:'/api/User/GetUsers'
    })
}
// 题库详情
export const GetSingleUser = (obj: any) => {
    return request({
        method: 'get',
        params: obj,
        url: '/api/User/GetSingleUser'
    })
}
//获取职务列表
export const GetZhiwuList=(obj:any)=>{
    return request({
        method:'get',
        params:obj,
        url:'/api/Organization/GetZhiwuList'
    })
}
//根据组织获取用户
export const GetUsersByOrg=(obj:any)=>{
    return request({
        method:'get',
        params:obj,
        url:'/api/Organization/GetUsersByOrg'
    })
}
//树形控件，组织列表
export const GetOrganizations=(obj:any)=>{
    return request({
        method:'get',
        params:obj,
        url:'/api/Organization/GetOrganizations'
    })
}
//新增用户
export const AddUser=(obj:any)=>{
    return request({
        method:'post',
        data:obj,
        url:'/api/User/AddUser'
    })
}
//禁用启用
export const BanUsers=(obj:any)=>{
    return request({
        method:'post',
        data:obj,
        url:'/api/User/BanUsers'
    })
}
//删除用户
export const DeleteUsers=(obj:any)=>{
    return request({
        method:'post',
        data:obj,
        url:'/api/User/DeleteUsers'
    })
}
//删除职务
export const DeleteZhiwu=(obj:any)=>{
    return request({
        method:'post',
        data:obj,
        url:'/api/Organization/DeleteZhiwu'
    })
}
//职务详情
export const GetSingleZhiwu=(obj:any)=>{
    return request({
        method:'get',
        params:obj,
        url:'/api/Organization/GetSingleZhiwu'
    })
}
//新增组织
export const AddOrganization=(obj:any)=>{
    return request({
        method:'post',
        data:obj,
        url:'/api/Organization/AddOrganization'
    })
}
//新增职务
export const AddZhiwu=(obj:any)=>{
    return request({
        method:'post',
        data:obj,
        url:'/api/Organization/AddZhiwu'
    })
}
//修改用户对象
export const UpdateUser=(obj:any)=>{
    return request({
        method:'post',
        data:obj,
        url:'/api/User/UpdateUser'
    })
}
//移动用户到组织
export const MoveUserToOrg=(obj:any)=>{
    return request({
        method:'post',
        data:obj,
        url:'/api/Organization/MoveUserToOrg'
    })
}